package com.eso.haBank.domain

/**
 * 系统菜单表Domain对象
 */

import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString

@EqualsAndHashCode
@ToString(includeNames = true, includeFields = false, excludes = 'metaClass,beforeInsert,beforeUpdate')
class SystemMenu implements Serializable {

    long id

    String comment;//描述

    String obligateField1;//预留字段1
    String obligateField2;//预留字段2
    String obligateField3;//预留字段3

    String createUser;
    Date createTime;
    String updateUser;
    Date updateTime;

    static constraints = {

        comment(nullable: true, maxSize: 200)

        obligateField1(nullable: true, maxSize: 500)
        obligateField2(nullable: true, maxSize: 500)
        obligateField3(nullable: true, maxSize: 500)

        createUser(blank: false, maxSize: 10)
        createTime(nullable: true)
        updateUser(blank: false, maxSize: 10)
        updateTime(nullable: true)
    }

    def beforeInsert = {
        createTime = new Date()
        updateTime = new Date()
    }

    def beforeUpdate = {
        updateTime = new Date()
    }

    static mapping = {
        table 'sys_menu'
        version false
    }
}
